<template>
  <tr>
    <td>合计:</td>
    <td colspan="5">{{ sum }}</td>
  </tr>
</template>

<script>
export default {
  props: ["arr"],
  data() {
    return {};
  },

  created() {},

  methods: {},
  computed: {
    sum() {
      return this.arr.reduce((sum, item) => {
        return (sum += item.num * item.price);
      }, 0);
    },
  },
};
</script>

<style scoped></style>
